<?php
class CV_Datastore_Metadata_Model_Provider_Relational_Field{
	private $_column;
	public function __construct( $column ){
		$this->_column = $column;

		$this->is_protected     = false;
		/*$this->name          = $this->_column->name;
		$this->default_value = $this->_column->default_value; 
		$this->length        = $this->length; 
		$this->is_readonly   = $this->_column->is_key;
		
		switch( $this->_column->type ){
			default:
				$this->type = 'text';
		}*/
	}
	public function get_name(){
		return $this->_column->get_name();
	}
	public function get_type(){
		if( $this->is_readonly() ){
			return 'readonly';
		} else {
			return 'text';
		}
		return $this->_column->get_type();
	}
	public function get_default_value(){
		return $this->_column->get_default_value();
	}
	public function get_length(){
		return $this->_column->get_length();
	}
	public function is_readonly(){
		return $this->_column->is_key() || $this->_column->is_current_timestamp();
	}
	function is_nullable(){
		return $this->_column->is_nullable();
	}
}